import logger from '../services/logger.js'

export const errorLogger = (err, req, res, next) => {
  logger.error('Error:', err)
  next(err)
}

export const errorHandler = (err, req, res, next) => {
  res.status(err.status || 500).json({
    message: err.message || 'Internal Server Error',
    ...(process.env.NODE_ENV === 'development' ? { stack: err.stack } : {})
  })
} 